home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Know Your Baseball - The Greatest Player Resource
/
Know Your Baseball - Greatest Player.iso
/
Baseball
/
Director
/
KTGCST.CST
/
00049_Script_PopUpSubMenu Script--using Movie in a window
< prev
next >
Wrap
Text File
|
1998-09-21
|
2KB
|
67 lines
-- the popup menu is a separate movie that is openined over the current movie
-- the global gPop stores the name of the popup window
global gSubPop, gPopButtonState, gPop
-- launches and positions the popup menu
on InitSubPopMenu
if gSubPop = (window "PopSubMenu") then
loseSubPop
else
set gSubPop = window "PopSubMenu"
set the filename of gSubPop to "SubPop" -- insert the name of the menu movie here
set the windowtype of gSubPop to 2
FindSubMenuLocation
open gSubPop
end if
end
-- examines the current location of the stage then positions the popup window correctly
on FindSubMenuLocation
set x = the rect of the stage
set topX = 160+(80+value(the top of x)) -- position on stage offset by the stage pos on the screen and the submenu position
set topY = 43+(260+value(the left of x))-- position on stage offset by the stage pos on the screen and the submenu position
set BottomX = 332+topX-- bottom corner = top corner plus desired window size (in bold)
set BottomY = 96+TopY--bottom corner = top corner plus desired window size (in bold)
-- set BottomLeft = value(item 3 of temp)
-- set BottomRight = value(item 4 of temp)
set the rect of gSubPop to rect(TopX,TopY,BottomX,BottomY)
end
-- closes the popup window
on LoseSubPop
if gSubPop = Empty or voidp(gSubPop) then exit
Close gSubPop
Forget gSubPop
Set gSubPop = Empty
end
-- set the button status on the popmenu to reflect the current selected screen
-- called from the popmenu in first exit frame script and the from the placename
-- buttons in the last line of the handler
on SetPopMenu
set the itemDelimiter to "."
set Name = the movieName
set N = item 1 of name
set Nnum = value(the last char of N)+28 -- uses the last char of the movie name(#)¼
and adds an offset to it to get the correct sprite channel in the popwindow
set the itemDelimiter to ","
tell gPop
puppetsprite Nnum, 1
setat(gPopButtonState,Nnum,2)
set the membernum of sprite Nnum = the membernum of sprite Nnum+1
set the visible of sprite Nnum to 1
updatestage
end tell
end